package com.yyysj.judge.controller;

import com.yyysj.api.domain.dto.JudgeSubmitDTO;
import com.yyysj.api.domain.vo.UserQuestionResultVO;
import com.yyysj.common.core.domain.Result;
import com.yyysj.judge.service.IJudgeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/judge")
@Slf4j
@RequiredArgsConstructor
public class JudgeController {

    private final IJudgeService judgeService;

    @PostMapping("/doJudgeJavaCode")
    public Result<UserQuestionResultVO> doJudgeJavaCode(@RequestBody JudgeSubmitDTO judgeSubmitDTO) {
        return Result.ok(judgeService.doJudgeJavaCode(judgeSubmitDTO));
    }
}
